package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appmarket.service.store.awk.card.SubCatCard;
import o.azb;
import o.cdr;
import o.chz;
import o.cih;
import o.eib;
import o.ewm.h;

public class SubCatNode extends cdr {
    public SubCatNode(Context context) {
        super(context, eib.ˈ());
    }

    public int ˏ() {
        return eib.ˈ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        int i = 0;
        viewGroup.setPadding(0, viewGroup.getPaddingTop(), 0, viewGroup.getPaddingBottom());
        int ˏ = ˏ();
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
        layoutParams.weight = 1.0f;
        while (i < ˏ) {
            View inflate = from.inflate(h.ˌॱ, null);
            azb.ˏ(inflate);
            inflate.setLayoutParams(layoutParams);
            cih subCatCard = new SubCatCard(this.ॱ);
            subCatCard.ˏ(inflate);
            ˊ(subCatCard);
            inflate.setClickable(true);
            viewGroup.addView(inflate);
            i++;
        }
        return true;
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        if (o_chz.ॱ == 0) {
            ((SubCatCard) ˎ(0)).ˋ();
            if (ˏ() == 2) {
                ((SubCatCard) ˎ(1)).ˋ();
            }
        }
        return super.ॱ(o_chz, viewGroup);
    }
}
